#include <android/log.h>
#include <string.h>
#include <jni.h>
#include "com_myapp_JNITest.h"
#include <asio.hpp>
#define DEBUG_TAG "NDK_AndroidNDK1SampleActivity"


namespace TEST {
	
	const char* GetName () {
		
		return "C++";
		
	}
	
	
	int TwoPlusTwo () {
		return 2 + 5;
		
	}


    int asiotest(){


    }
	
};
	
JNIEXPORT jint JNICALL
Java_com_myapp_JNITest_plus( JNIEnv* env, jobject thiz, jint x, jint y )
{
	__android_log_print(ANDROID_LOG_DEBUG, DEBUG_TAG, "NDK:LC: [%s]", "hello log");


   jstring jstr = env->NewStringUTF("This comes from jni111.中文");
   jclass clazz = env->FindClass("com/myapp/JNITest");
   jmethodID messageMe = env->GetMethodID( clazz, "messageMe", "(Ljava/lang/String;)Ljava/lang/String;");
   jobject result = env->CallObjectMethod(thiz, messageMe, jstr);
   const char* str = env->GetStringUTFChars((jstring) result, NULL); // should be released but what a heck, it's a tutorial :)

   //printf("%s\n", str);



   return x+y;

}

